<?php

class ChauffageActiveRecord extends CActiveRecord {

    private static $dbchauffage = null;
 
    protected static function getChauffageDbConnection()
    {
        if (self::$dbchauffage !== null)
            return self::$dbchauffage;
        else
        {
            self::$dbchauffage = Yii::app()->dbchauffage;
            if (self::$dbchauffage instanceof CDbConnection)
            {
                self::$dbchauffage->setActive(true);
                return self::$dbchauffage;
            }
            else
                throw new CDbException(Yii::t('yii','Active Record requires a "db" CDbConnection application component.'));
        }
    }
}
